/*
 * MMAGrid.java
 *
 * Created on September 20, 2004, 7:25 PM
 */

package edu.temple.GUS.MMA.DataTypes;

import java.util.ArrayList;
import edu.temple.GUS.MMA.Neighborhoods.*;
import edu.temple.GUS.MMA.misc.*;
import edu.temple.GUS.MMA.util.StatisticalOperator;

/**
 *
 * @author  jeffleon
 */
public class MMAGrid {
    
    // Grid attributes
    private int x;
    private int y;
    private int xResolution;
    private int yResolution;
    private float xLL;
    private float yLL;
    private float noData;   // No data value
    private float data[][];
    
    /** Creates a new instance of MMAGrid */
    public MMAGrid() {}

    public MMAGrid(int x, int y)
    {
        this.x = x;
        this.y = y;
    }
    
    public MMAGrid(int x, int y, int xResolution, int yResolution)
    {
        this.x = x;
        this.y = y;
        this.xResolution = xResolution;
        this.yResolution = yResolution;
    }

    public MMAGrid(int x, int y, int xResolution, int yResolution, float xLL, float yLL)
    {
        this.x = x;
        this.y = y;
        this.xLL = xLL;
        this.yLL = yLL;
        this.xResolution = xResolution;
        this.yResolution = yResolution;
    }

    // Member variable access functions
    public int getX() { return x; }
    public int getY() { return y; }
    public float getXLL() { return xLL; }
    public float getYLL() { return yLL; }
    public int getXResolution() { return xResolution; }
    public int getYResolution() { return yResolution; }
    public float getNoData() { return noData; }
    
    //Retrieve an element value of a grid
    //where x and y represent the indexes
    public float getElement(int x, int y) {
        if (data != null)
            return data[y][x];
        else
            return 0.0f;
    }
    
    public float[][] getData() { return data; }

    public void putX(int x) { this.x = x; }
    public void putY(int y) { this.y = y; }
    public void putXLL(float xLL) { this.xLL = xLL; }
    public void putYLL(float yLL) { this.yLL = yLL; }
    public void putXResolution(int xResolution) { this.xResolution = xResolution; }
    public void putYResolution(int yResolution) { this.yResolution = yResolution; }
    public void putData(float inputData[][]) { data = inputData; }
    public void putNoData(float noData) { this.noData = noData; }
}